﻿var status = 0;
var typed = 0;

function start() {
    status = -1;
    action(1, 0, 0);
}

function action(mode, type, selection) {
    if (status == 0 && mode == 0) {
        cm.dispose();
        return;
    }
    if (mode == 1) {
        status++;
    } else {
        status--;
    }
	if (status == 0) {	
	if (cm.getMapId() == 807300110) {
      cm.sendYesNo("您真的要放弃挑战吗?");
    } else {
        var selStr = "#r#e<森兰丸祭台>#n\r\n#k请选择您想要挑战的难度.\r\n#b#L1#普通模式。(120级以上)\r\n#L2#困难模式。(180级以上)";
        cm.sendSimple(selStr);
	}
    } else if (status == 1) {
		if (cm.getMapId() == 807300110) {
		cm.sendNext("真没耐心。如果你非要走的话，我也不会拦你。再见。");
		} else {
        switch (selection) {
        case 1:
			cm.dispose();
			cm.openNpc(9130087, 2);
        break;
        case 2:
			cm.dispose();
			cm.openNpc(9130087, 3);
        break;
        }
		}
	} else if (status == 2) {
        cm.warp(910000000);
        cm.dispose();
    }
}